--
-- PostgreSQL database dump
--

-- Dumped from database version 12.22
-- Dumped by pg_dump version 12.22

SET statement_timeout = 0;
SET lock_timeout = 0;
SET idle_in_transaction_session_timeout = 0;
SET client_encoding = 'UTF8';
SET standard_conforming_strings = on;
SELECT pg_catalog.set_config('search_path', '', false);
SET check_function_bodies = false;
SET xmloption = content;
SET client_min_messages = warning;
SET row_security = off;

--
-- Name: pgcrypto; Type: EXTENSION; Schema: -; Owner: -
--

CREATE EXTENSION IF NOT EXISTS pgcrypto WITH SCHEMA public;


--
-- Name: EXTENSION pgcrypto; Type: COMMENT; Schema: -; Owner: -
--

COMMENT ON EXTENSION pgcrypto IS 'cryptographic functions';


--
-- Name: uuid-ossp; Type: EXTENSION; Schema: -; Owner: -
--

CREATE EXTENSION IF NOT EXISTS "uuid-ossp" WITH SCHEMA public;


--
-- Name: EXTENSION "uuid-ossp"; Type: COMMENT; Schema: -; Owner: -
--

COMMENT ON EXTENSION "uuid-ossp" IS 'generate universally unique identifiers (UUIDs)';


--
-- Name: update_timestamp(); Type: FUNCTION; Schema: public; Owner: -
--

CREATE FUNCTION public.update_timestamp() RETURNS trigger
    LANGUAGE plpgsql
    AS $$
BEGIN
    NEW.update_time = CURRENT_TIMESTAMP;
    RETURN NEW;
END;
$$;


SET default_tablespace = '';

SET default_table_access_method = heap;

--
-- Name: mood_records; Type: TABLE; Schema: public; Owner: -
--

CREATE TABLE public.mood_records (
    id uuid DEFAULT public.gen_random_uuid() NOT NULL,
    user_id uuid NOT NULL,
    category character varying(10) DEFAULT ''::character varying,
    emotion character varying(10) DEFAULT ''::character varying,
    content text DEFAULT ''::text,
    date timestamp with time zone DEFAULT CURRENT_TIMESTAMP,
    summary text DEFAULT ''::text,
    image_url character varying(256) DEFAULT ''::character varying
);


--
-- Name: users; Type: TABLE; Schema: public; Owner: -
--

CREATE TABLE public.users (
    phone character varying(11) NOT NULL,
    password_hash character varying(128),
    email character varying(128),
    created_at timestamp without time zone DEFAULT now(),
    id uuid DEFAULT public.uuid_generate_v4() NOT NULL,
    avatar_url character varying(255),
    nickname character varying(50),
    gender character(10),
    signature text,
    long_term_memory text
);


--
-- Data for Name: mood_records; Type: TABLE DATA; Schema: public; Owner: -
--

COPY public.mood_records (id, user_id, category, emotion, content, date, summary, image_url) FROM stdin;
9258eb75-1964-4d15-b331-27fd4858de48	ea92595b-0c01-4b71-b017-24af94274c3f	积极	平静		2025-05-17 11:37:26.915868+08		
ec15a194-0d03-42b2-9b54-0f27656bcfa9	ea92595b-0c01-4b71-b017-24af94274c3f	积极	平静		2025-05-02 11:37:26.915868+08		
6b49ca65-ee78-404b-9135-6a0adcebc168	ea92595b-0c01-4b71-b017-24af94274c3f	积极	平静		2025-05-03 11:37:26.915868+08		
b9797975-9768-4c01-9266-d6440c0c9442	ea92595b-0c01-4b71-b017-24af94274c3f	积极	平静		2025-05-04 11:37:26.915868+08		
2c135466-7c5c-4171-8b11-e5d605b4a006	ea92595b-0c01-4b71-b017-24af94274c3f	积极	平静		2025-05-05 11:37:26.915868+08		
4628de2b-380e-4779-aece-c8be30b3eb92	ea92595b-0c01-4b71-b017-24af94274c3f	积极	平静		2025-05-06 11:37:26.915868+08		
fb7b6aca-a915-4bbb-941f-d8a698abda24	ea92595b-0c01-4b71-b017-24af94274c3f	积极	平静		2025-05-07 11:37:26.915868+08		
80947512-56e7-4dc3-8f42-c968ae9a168c	ea92595b-0c01-4b71-b017-24af94274c3f	积极	平静		2025-05-08 11:37:26.915868+08		
29ad5af0-e779-4e2a-98ec-d46f028aec13	ea92595b-0c01-4b71-b017-24af94274c3f	积极	平静		2025-05-09 11:37:26.915868+08		
70e32f31-1920-47fe-945b-e918aafe00f7	ea92595b-0c01-4b71-b017-24af94274c3f	积极	平静		2025-05-10 11:37:26.915868+08		
2a7f38d0-61eb-444a-925c-18a6917cf842	ea92595b-0c01-4b71-b017-24af94274c3f	积极	平静		2025-05-11 11:37:26.915868+08		
4b5305f4-3b84-4503-965e-6ae29f515ef7	ea92595b-0c01-4b71-b017-24af94274c3f	积极	平静		2025-05-12 11:37:26.915868+08		
cdddacae-159f-48d3-afbb-046e154d7b39	ea92595b-0c01-4b71-b017-24af94274c3f	积极	平静		2025-05-13 11:37:26.915868+08		
cf6927c1-3938-46e4-8cd8-6319e81b2c26	ea92595b-0c01-4b71-b017-24af94274c3f	积极	平静		2025-05-14 11:37:26.915868+08		
e7a613f9-0c49-4d1b-8de1-3648791f72c8	ea92595b-0c01-4b71-b017-24af94274c3f	积极	平静		2025-05-15 11:37:26.915868+08		
2eecd658-6fd9-41ca-9554-4f90c69ac3f2	ea92595b-0c01-4b71-b017-24af94274c3f	积极	平静		2025-05-16 11:37:26.915868+08		
982bb99a-d6ce-4e6e-b346-5692e92f91fd	ea92595b-0c01-4b71-b017-24af94274c3f	积极	平静		2025-05-18 11:37:26.915868+08		
333e904a-dded-424c-98e3-94398c47ed49	ea92595b-0c01-4b71-b017-24af94274c3f	积极	平静	今天是真的累	2025-05-25 14:56:17.573662+08		
2a295290-f1ef-45a8-ac1d-bb90fb2e6ca9	ea92595b-0c01-4b71-b017-24af94274c3f	积极	平静	元气满满的一天呢	2025-05-25 11:37:26.915868+08		
e2f35161-85a2-4463-9aed-b67edf21c41a	ea92595b-0c01-4b71-b017-24af94274c3f	消极	抑郁	活人微死，emo中	2025-05-19 11:37:26.915868+08		
07dbccbe-2b01-43a2-9a39-7574336d1a01	ea92595b-0c01-4b71-b017-24af94274c3f	消极	焦虑	好想毕业啊啊啊啊啊啊啊啊啊啊啊啊啊啊啊啊啊啊啊啊	2025-05-21 11:37:26.915868+08		
220000df-46fc-452c-806e-9af3534167df	ea92595b-0c01-4b71-b017-24af94274c3f	积极	平静	元气满满的一天呢	2025-05-20 11:37:26.915868+08		
\.


--
-- Data for Name: users; Type: TABLE DATA; Schema: public; Owner: -
--

COPY public.users (phone, password_hash, email, created_at, id, avatar_url, nickname, gender, signature, long_term_memory) FROM stdin;
16603067314	$2b$12$Zdg0t6NUNDixqRIJN28OZ.5ecPf15XvzKgvqVybRdTsZvtyxXda6u	456@qq.com	2025-05-25 11:37:26.915868	2d680754-f1f2-43b2-8d63-af34397009da	static/avatar/2d680754-f1f2-43b2-8d63-af34397009da.jpg	新昵称	女         	个性签名测试	{}
19801296231	$2b$12$aUiXUShMisauB7eIHgeboOWX6w6rssVYuzlkUiC7o7nxf7MsOG/Lm	123@qq.com	2025-05-08 14:20:33.854015	ea92595b-0c01-4b71-b017-24af94274c3f	\N	冬瓜瓜	男         	，，，	{}
\.


--
-- Name: mood_records mood_records_pkey; Type: CONSTRAINT; Schema: public; Owner: -
--

ALTER TABLE ONLY public.mood_records
    ADD CONSTRAINT mood_records_pkey PRIMARY KEY (id);


--
-- Name: users users_id_uuid_key; Type: CONSTRAINT; Schema: public; Owner: -
--

ALTER TABLE ONLY public.users
    ADD CONSTRAINT users_id_uuid_key UNIQUE (id);


--
-- Name: users users_phone_key; Type: CONSTRAINT; Schema: public; Owner: -
--

ALTER TABLE ONLY public.users
    ADD CONSTRAINT users_phone_key UNIQUE (phone);


--
-- Name: users users_pkey; Type: CONSTRAINT; Schema: public; Owner: -
--

ALTER TABLE ONLY public.users
    ADD CONSTRAINT users_pkey PRIMARY KEY (id);


--
-- Name: mood_records fk_user; Type: FK CONSTRAINT; Schema: public; Owner: -
--

ALTER TABLE ONLY public.mood_records
    ADD CONSTRAINT fk_user FOREIGN KEY (user_id) REFERENCES public.users(id);


--
-- PostgreSQL database dump complete
--

